package com.huawei.game;

import com.huawei.service.StoneScissorClothImpl;

import java.util.Random;
import java.util.Scanner;

public class Game {
    public static void main(String[] args) {
        StoneScissorClothImpl standard= new StoneScissorClothImpl();

        Random random=new Random();
        int computer =random.nextInt(3);

        Scanner input = new Scanner(System.in);
        int person = input.nextInt();
        System.out.println("开始游戏->");
        System.out.println("《石头，剪刀，布》");
        int w = 0;//玩家获胜场数
        int d = 0;//玩家平局场数
        for (int i = 1; i <= 5; i++) {
            System.out.println("第" + i + "局");
            String enter = input.next();//接受玩家输入的字符
            switch (standard.gameStandard(person, computer)) {
                case 0:
                    break;
                case 1:
                    w++;
                    break;
                case 2:
                    d++;
                    break;
            }
        }
        if (w>(5-w-d) ) {
            System.out.println("你获胜了！");
        }else if(w==(5-w-d)) {
            System.out.println("和局！");
        }else {
            System.out.println("电脑获胜！");
        }
    }
}
